package gis.utils;

import org.osgeo.proj4j.CRSFactory;
import org.osgeo.proj4j.CoordinateReferenceSystem;
import org.osgeo.proj4j.ProjCoordinate;
import org.osgeo.proj4j.proj.Projection;

/**
 * Created by Administrator on 2016/3/24.
 */
public class Coord {

    public static Double[] Coord2(double x,double y) {
        CRSFactory crsFactory = new CRSFactory();
        CoordinateReferenceSystem projUTN = crsFactory.createFromParameters("EPSG:32653", "+proj=utm +zone=53 +ellps=WGS84 +datum=WGS84 +units=m +no_defs");
        Projection projection = projUTN.getProjection();
        ProjCoordinate projCoordinate = new ProjCoordinate(x,y);
        ProjCoordinate dst = new ProjCoordinate();
        projection.project(projCoordinate, dst);
        return new Double[]{dst.x,dst.y};
    }


}
